﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MyAgent : MonoBehaviour
{
    private List<Vector3> mPoints;

    public void SetTarget(Transform tTransform)
    {
        mPoints = AStar.Instance.FindWay(transform.position, tTransform.position);
        StartMove();
    }

    void StartMove()
    {

    }

    void OnDrawGizmos()
    {
        Gizmos.color = Color.red;
        if (mPoints != null)
        {
            for (int i = 0; i < mPoints.Count - 1; i++)
            {
                Vector3 pos1 = mPoints[i];
                Vector3 pos2 = mPoints[i + 1];
                Gizmos.DrawLine(pos1, pos2);
            }
        }
    }
}
